#include "DIALOG.h"
#include "MC_include.h"
#include "Maintask.h"


#define ID_FRAMEWIN_5     (GUI_ID_USER + 0xc0)
#define ID_HELPMULTIEDIT_0     (GUI_ID_USER + 0x902)


static const GUI_WIDGET_CREATE_INFO _aDialogCreate[] =
{
    { FRAMEWIN_CreateIndirect, "Framewin", ID_FRAMEWIN_5, 0, 0, 800, 480, 0, 0x64, 0 },
    { MULTIEDIT_CreateIndirect, "Multiedit", ID_HELPMULTIEDIT_0, 45, 72, 670, 333, 0, 0x0, 0 },
    // USER END
};

static void _cbDialog(WM_MESSAGE * pMsg)
{
    WM_HWIN hItem;
    // USER START (Optionally insert additional variables)
    // USER END

    switch (pMsg->MsgId)
    {
        case WM_INIT_DIALOG:
            //
            // Initialization of 'Framewin'
            //
			hItem = pMsg->hWin;
			FRAMEWIN_SetSkinClassic(hItem);
			FRAMEWIN_SetActive(hItem,1);
			FRAMEWIN_SetTitleHeight(hItem, 32);
			FRAMEWIN_SetFont(hItem, &GUI_Fontfont20B);
			FRAMEWIN_SetTextAlign(hItem, GUI_TA_LEFT | GUI_TA_VCENTER);
			FRAMEWIN_SetText(hItem, "帮助");
			FRAMEWIN_AddCloseButton(hItem,FRAMEWIN_BUTTON_RIGHT,0);
            FRAMEWIN_SetClientColor(hItem, GUI_MAKE_COLOR(0x00E7E7E7));

		    hItem = WM_GetDialogItem(pMsg->hWin, ID_HELPMULTIEDIT_0);
		MULTIEDIT_SetText(hItem, "This is a help infomation.\nAuthor:wang huiyun\nVersion:V1.0");
			MULTIEDIT_SetTextColor(hItem, MULTIEDIT_CI_EDIT, GUI_MAKE_COLOR(0x00000000));
			MULTIEDIT_SetFont(hItem, GUI_FONT_32_1);
            break;

        // USER START (Optionally insert additional message handling)
        // USER END
        default:
            WM_DefaultProc(pMsg);
            break;
    }
}


WM_HWIN CreateHelpwin(void);
WM_HWIN CreateHelpwin(void)
{
    WM_HWIN hWin;

    hWin = GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), _cbDialog, WM_HBKWIN, 0, 0);
    return hWin;
}

// USER START (Optionally insert additional public code)
// USER END

/*************************** End of file ****************************/
